﻿<Window x:Class="Zeus.Wpf.DataViewer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:EfNorthwind="clr-namespace:Zeus.Biz.Northwind.Model;assembly=Zeus.Biz.Northwind.Model"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        Title="MainWindow" Height="400" Width="500"
        Background="Black" Foreground="#FF008028" FontFamily="Consolas">
    <Window.Resources>
        <Style TargetType="ListViewItem">
            <Style.Resources>
                <!-- Prevent list items from appearing like they've been selected -->
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#d9d900" />
            </Style.Resources>
        </Style>
        
        <!-- How to display Employee  listings -->
        <DataTemplate DataType="{x:Type EfNorthwind:Employee}">
            <Border Name="border" BorderBrush="ForestGreen" BorderThickness="1" Padding="5" Margin="5">
                <StackPanel>
                    <TextBlock Text="{Binding Path=FirstName}" FontWeight="Bold" FontSize="12"/>
                    <TextBlock Text="{Binding Path=LastName}"  FontSize="12"/>
                    <ListView ItemsSource="{Binding Path=Orders}" HorizontalContentAlignment="Stretch" BorderThickness="0" Background="#ffa87d">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock>
                                    <Hyperlink CommandParameter="{Binding}"><TextBlock Text="{Binding Path=OrderID}"/></Hyperlink>
                                </TextBlock>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Window.Resources>

    <DockPanel>
        <ToolBar DockPanel.Dock="Top" HorizontalContentAlignment="Stretch" Background="#a5ffa5">
            <Label FontWeight="Bold" Foreground="#0000f9">Display:</Label>
            <Button Name="BookButton" Foreground="#ff9562">All Employees</Button>
            <Separator></Separator>
            <Button Name="AuthorButton" Foreground="#ff9562">Flights</Button>
            <Separator></Separator>
            <Button Name="CategoryButton" Foreground="#ff9562">Hotels</Button>
            <Separator></Separator>
        </ToolBar>
        <StatusBar DockPanel.Dock="Bottom" Height="24">
            <StatusBarItem Name="StatusText" Foreground="#FF009B00"></StatusBarItem>
        </StatusBar>

        <!-- See DataTemplates above for how the listings are displayed, it will vary based on what object type is being displayed -->
        <ListView Name="Listing" ItemsSource="{Binding}" HorizontalContentAlignment="Stretch" Background="#90000000" Foreground="#FF00A400" />
    </DockPanel>
</Window>
